package com.CardBudgetBook.Outlay;

import java.util.ArrayList;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import com.CardBudgetBook.R;
import com.CardBudgetBook.Statistics.StatisticsActivity;

public class OutlayActivity extends Activity implements OnItemClickListener {

	ListView list;
	ArrayList<Integer> numbers;
	ArrayAdapter<Integer> adapter;

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.outlay_basic_list);

		list = (ListView) findViewById(R.id.list);
		numbers = new ArrayList<Integer>();
		for (int i = 1; i < 11; i++) {
			numbers.add(i);
		}

		adapter = new ArrayAdapter<Integer>(this,
				android.R.layout.simple_list_item_1, numbers);
		list.setAdapter(adapter);
		// TODO Auto-generated method stub
	}

	public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {
		// TODO Auto-generated method stub
		
		Log.d("Position", String.valueOf(position));
		
		Intent intent = new Intent(this, StatisticsActivity.class);
		startActivity(intent);
	}

}
